home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / richink.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  7.3 KB  |  258 lines

  1. //***************************************************************************
  2. //
  3. //    Copyright (c) 1997-1999  Microsoft Corporation.  All Rights Reserved.
  4. //
  5. //    File:
  6. //            richink.h
  7. //
  8. //    Description:
  9. //
  10. //            Include file for WinCE RichInk Edit Control.
  11. //
  12. //***************************************************************************
  13.  
  14. #ifndef _RICHINK_INCLUDED_
  15. #define _RICHINK_INCLUDED_
  16.  
  17. #include <windows.h>
  18. #include <commctrl.h>
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif // __cplusplus
  23.  
  24.  
  25. // Constants
  26.  
  27. #define WC_RICHINKA   "RichInk"
  28. #define WC_RICHINKW  L"RichInk"
  29. #ifdef UNICODE
  30. #define WC_RICHINK    WC_RICHINKW
  31. #else
  32. #define WC_RICHINK    WC_RICHINKA
  33. #endif
  34.  
  35. // Application calls this function to load and initialize the control properly.
  36. // The control can be inserted as a dialog custom control with class setting "RichInk"
  37. //  (see constant WC_RICHINK above).
  38. #ifdef _WIN32_WCE_EMULATION
  39. void WINAPI InitRichInkDLL(void);
  40. #else
  41. void InitRichInkDLL(void);
  42. #endif
  43.  
  44.  
  45. // Defines and typedefs needed for the Rich Ink stream messages.
  46.  
  47. //---------------------------------------------------------
  48. // EditStreamCallback
  49. //
  50. //    The EditStreamCallback function is an application-defined
  51. //    callback function used with the EM_STREAMIN and EM_STREAMOUT
  52. //    messages. It is used to transfer a stream of data into or
  53. //    out of a rich edit control. The EDITSTREAMCALLBACK type defines
  54. //    a pointer to this callback function. EditStreamCallback is a
  55. //    placeholder for the application-defined function name. 
  56. //
  57. // SEE Microsoft Developer Studio Help or MSDN for more details.
  58. //---------------------------------------------------------
  59. typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)
  60. (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
  61.  
  62. DWORD CALLBACK EditStreamCallback(
  63.   DWORD dwCookie, // application-defined value
  64.   LPBYTE pbBuff,  // pointer to a buffer
  65.   LONG cb,        // number of bytes to read or write
  66.   LONG *pcb       // pointer to number of bytes transferred
  67. );
  68.  
  69. typedef struct _editstream
  70. {
  71.     DWORD dwCookie;        /* user value passed to callback as first parameter */
  72.      DWORD dwError;        /* last error */
  73.     EDITSTREAMCALLBACK pfnCallback;
  74. } EDITSTREAM;
  75.  
  76. typedef struct tagCOOKIE
  77. {
  78.     HANDLE hFile;
  79.     LPBYTE pbStart;
  80.     LPBYTE pbCur;
  81.     LONG   bCount;
  82.     DWORD  dwError;
  83. } COOKIE, * PCOOKIE;
  84.  
  85.  
  86. // Stream formats:
  87. #define SF_TEXT            0x0001
  88. #define SF_RTF            0x0002
  89.  
  90. #define SF_UNICODE        0x0010                            // Unicode data of some kind
  91. #define SF_UTEXT        SF_TEXT | SF_UNICODE            // Unicode text file
  92.  
  93. #define SFF_PWI            0x0800        
  94. #define SF_PWI            ( SF_RTF | SFF_PWI | 0x010000 )    // Pocket Word Ink (PWI) format
  95.  
  96.  
  97. // Supported EM_ and WM_ Messages:
  98.  
  99. //---------------------------------------------------------
  100. //
  101. //    EM_STREAMIN
  102. //    
  103. //    The EM_STREAMIN message replaces the contents of a rich ink
  104. //    control with a stream of data provided by an application-defined
  105. //    EditStreamCallback callback function.
  106. //
  107. //
  108. //    wParam = (WPARAM) (UINT) uFormat; 
  109. //    lParam = (LPARAM) (EDITSTREAM FAR *) lpStream; 
  110. // 
  111. //    Parameters
  112. //
  113. //        uFormat 
  114. //
  115. //        A set of bit flags that indicate the data format and replacement options.
  116. //        This value must specify one of the following data formats.
  117. //
  118. //        SF_TEXT        Ascii Text 
  119. //        SF_RTF        Rich Text Format (RTF) 
  120. //        SF_UTEXT    Unicode text
  121. //        SF_PWI        Pocket Word Ink (PWI)
  122. //
  123. //
  124. //        lStream 
  125. //        Pointer to an EDITSTREAM structure. On input, the pfnCallback member of
  126. //        this structure must point to an application-defined EditStreamCallback
  127. //        function. On output, the dwError member can contain a nonzero error code
  128. //        if an error occurred. 
  129. //
  130. //        Return Values
  131. //
  132. //        Returns zero if no errors.
  133. //
  134. //        Remarks
  135. //
  136. //        When you send an EM_STREAMIN message, the rich ink control makes
  137. //        repeated calls to the EditStreamCallback function specified by the
  138. //        pfnCallback member of the EDITSTREAM structure. 
  139. //        Each time the callback function is called, it fills a buffer with
  140. //        data to read into the control. This continues until the callback
  141. //        function indicates that the stream-in operation has been completed
  142. //        or an error occurs.
  143. //
  144. //---------------------------------------------------------
  145. #define EM_STREAMIN                (WM_USER + 73)
  146.  
  147.  
  148. //---------------------------------------------------------
  149. //
  150. //    EM_STREAMOUT
  151. //    
  152. //    The EM_STREAMOUT message causes a rich ink control to pass
  153. //    its contents to an application-defined EditStreamCallback callback
  154. //    function. The callback function can then write the stream of data
  155. //    to a file or any other location that it chooses. 
  156. //
  157. //    wParam = (WPARAM) (UINT) uFormat; 
  158. //    lParam = (LPARAM) (EDITSTREAM FAR *) lpStream; 
  159. // 
  160. //    Parameters
  161. //
  162. //        uFormat 
  163. //
  164. //        A set of bit flags that indicate the data format and replacement options.
  165. //        This value must specify one of the following data formats.
  166. //
  167. //        SF_TEXT        Ascii Text 
  168. //        SF_RTF        Rich Text Format (RTF) 
  169. //        SF_UTEXT    Unicode text
  170. //        SF_PWI        Pocket Word Ink (PWI)
  171. //
  172. //
  173. //        lStream 
  174. //
  175. //        Pointer to an EDITSTREAM structure. On input, the pfnCallback member
  176. //        of this structure must point to an application-defined EditStreamCallback
  177. //        function. On output, the dwError member can contain a nonzero error code
  178. //        if an error occurred. 
  179. //
  180. //        Return Values
  181. //
  182. //        Returns zero if no errors.
  183. //
  184. //        Remarks
  185. //
  186. //        When you send an EM_STREAMOUT message, the rich ink control makes
  187. //        repeated calls to the EditStreamCallback function specified by the
  188. //        pfnCallback member of the EDITSTREAM structure. Each time it calls
  189. //        the callback function, the control passes a buffer containing a
  190. //        portion of the contents of the control. This process continues until
  191. //        the control has passed all its contents to the callback function,
  192. //        or until an error occurs.
  193. //
  194. //---------------------------------------------------------
  195. #define EM_STREAMOUT            (WM_USER + 74)
  196.  
  197.  
  198. //---------------------------------------------------------
  199. // IMPORTANT COMPATIBILITY NOTE:
  200. //
  201. //    Previous versions of the richink.dll required the EM_STREAMIN
  202. //    and EM_STREAMOUT messages to the uFormat parameter rather
  203. //  than passing the uFormat directly.
  204. //
  205. //    DWORD    wpSF = SF_PWD;
  206. //
  207. //    SendMessage (hwndInk, EM_STREAMIN, (WPARAM)&wpSF, (LPARAM)&es);
  208. //---------------------------------------------------------
  209.  
  210.  
  211. //---------------------------------------------------------
  212. //
  213. //    EM_CLEARALL
  214. //    
  215. //    The EM_CLEARALL message causes a rich ink control to clear
  216. //    all of the current documents data.
  217. //
  218. //    wParam = (WPARAM) (BOOL) fDirty; 
  219. //    lParam = (LPARAM) 0; 
  220. // 
  221. //    Parameters
  222. //
  223. //        fDirty -- true to dirty window for repaint after clear. 
  224. //
  225. //---------------------------------------------------------
  226. #define EM_CLEARALL                (WM_USER + 331)
  227.  
  228.  
  229. //---------------------------------------------------------
  230. //
  231. // Other useful Rich Edit control and Windows messages 
  232. //    that are supported by the Rich Ink control:
  233. //
  234. //        EM_GETSEL
  235. //        EM_SETSEL
  236. //        EM_REPLACESEL
  237. //        EM_GETMODIFY
  238. //        EM_SETMODIFY
  239. //
  240. //        WM_GETTEXTLENGTH
  241. //        WM_GETTEXT
  242. //        WM_SETTEXT 
  243. //
  244. //      WM_CUT
  245. //      WM_COPY
  246. //      WM_PASTE
  247. //      WM_CLEAR
  248. //      EM_CANPASTE
  249. //
  250. // See Microsoft Developer Studio Help or MSDN for more details.
  251. //---------------------------------------------------------
  252.  
  253. #ifdef __cplusplus
  254. }
  255. #endif // __cplusplus
  256.  
  257. #endif // _RICHINK_INCLUDED_
  258.